package com.ucode.search.crm.model;

import java.io.Serializable;
import java.util.Date;

import com.ucode.springboot.starter.ESsearch.annotation.Analyzer;
import com.ucode.springboot.starter.ESsearch.annotation.ESDocument;
import com.ucode.springboot.starter.ESsearch.annotation.ESField;
import com.ucode.springboot.starter.ESsearch.enums.DataType;
/**
 * 客户
 * @author: liliang
 * @date: 2019年12月10日 下午2:15:43
 */
@SuppressWarnings("serial")
@ESDocument(indexName="crm_customer",idFieldName="id")
public class ESCustomer implements Serializable {

    @ESField(datatype = DataType.long_type,keyword=false)
    private Long id;// ID
    
    @ESField(datatype = DataType.date_type,keyword=false)
    private Date createdTime;// 入库时间

    @ESField(datatype = DataType.date_type,keyword=false)
    private Date updatedTime;// 更新时间
    
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer deltag;//删除标记 0未删除1已删除
    
    /**
     * 客户名称
     */
    @ESField(datatype = DataType.text_type,keyword= true,ngram=true,suggest=true,analyzer=Analyzer.ik_smart)
    private String name;
    /**
     * 客户级别
     * 客户级别:1.S类,2.A类3.B类4.C类5.D类
     */
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer level;
    /**
     * 客户来源
     * 1.促销活动 2.搜索引擎 3.广告 4.转介绍 5.线上注册 6.线上询价 7.预约上门 8.陌拜 9.电话咨询 10.电销 100其他
     */
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer source;
    /**
     * 客户行业
     * 1.互联网IT 2.金融业 3.地产/建筑业 4.服务业 5.运输/物流 6.生产制造业 7.国家党政机关 8.文化传媒业 9.生物医药业10.能源材料业 100.其他
     */
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer industry;
    /**
     * 跟进次数
     */
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer followCount;
    /**
     * 成交次数
     */
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer dealCount;
    /**
     * 商机数量
     */
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer businessCount;
    /**
     * 最后联系时间
     */
    @ESField(datatype = DataType.date_type,keyword=false)
    private Date lastTime;
    /**
     * 下次联系时间
     */
    @ESField(datatype = DataType.date_type,keyword=false)
    private Date nextTime;
    /**
     * 网址
     */
    @ESField(datatype = DataType.text_type,keyword= false)
    private String website;
    /**
     * 客户备注
     */
    @ESField(datatype = DataType.text_type,keyword= true,ngram=true,suggest=true,analyzer=Analyzer.ik_smart)
    private String remark;
    
    /**
     * 标签
     */
    @ESField(datatype = DataType.text_type,keyword= true,analyzer=Analyzer.ik_smart)
    private String tags;
    
    /**
     * 省
     */
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer provinceId;
    /**
     * 市
     */
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer cityId;
    /**
     * 区
     */
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer areaId;
    
    /**
     * 详细地址
     */
    @ESField(datatype = DataType.text_type,keyword= true,ngram=true,suggest=true,analyzer=Analyzer.ik_smart)
    private String address;
    
    /**
     * 锁定状态:0->解锁1->锁定
     */
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer lockStatus;
    
    /**
     * 首要联系人手机号
     */
    @ESField(datatype = DataType.text_type,keyword= true,ngram=true,suggest=true)
    private String mobile;
    /**
     * 首要联系人电话
     */
    @ESField(datatype = DataType.text_type,keyword= true,ngram=true,suggest=true)
    private String telephone;
    
    /**
     * 首要联系人性别
     */
    @ESField(datatype = DataType.integer_type,keyword=false)
    private Integer sex;
    
    /**
     * 首要联系人生日
     */
    @ESField(datatype = DataType.date_type,keyword=false)
    private Date birthday;
    /**
     * 首要联系人姓名
     */
    @ESField(datatype = DataType.text_type,keyword= true,ngram=true,suggest=true,analyzer=Analyzer.ik_smart)
    private String cname;
    /**
     * 默认联系人
     */
    @ESField(datatype = DataType.long_type,keyword=false)
    private Long contactsId;
    /**
     * 创建人
     */
    @ESField(datatype = DataType.long_type,keyword=false)
    private Long createUserId;
    /**
     * 负责人
     */
    @ESField(datatype = DataType.long_type,keyword=false)
    private Long ownerUserId;
    
    /**
     * 负责人Id关键字，同ownerUserId一致
     */
    @ESField(datatype = DataType.text_type,keyword= true)
    private String ownerUserIdStr;
    /**
     * 销售协作人，多人之间用,隔开
     */
    @ESField(datatype = DataType.text_type,keyword= true,analyzer=Analyzer.ik_smart)
    private String collaborator;
    /**
     * 售后负责人
     */
    @ESField(datatype = DataType.long_type,keyword=false)
    private Long saUserId;
    
    /**
     * 售后负责人
     */
    @ESField(datatype = DataType.text_type,keyword= true)
    private String saUserIdStr;
    
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Date getCreatedTime() {
        return createdTime;
    }
    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }
    public Date getUpdatedTime() {
        return updatedTime;
    }
    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }
    public Integer getDeltag() {
        return deltag;
    }
    public void setDeltag(Integer deltag) {
        this.deltag = deltag;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getLevel() {
        return level;
    }
    public void setLevel(Integer level) {
        this.level = level;
    }
    public Integer getSource() {
        return source;
    }
    public void setSource(Integer source) {
        this.source = source;
    }
    public Integer getIndustry() {
        return industry;
    }
    public void setIndustry(Integer industry) {
        this.industry = industry;
    }
    public Integer getFollowCount() {
        return followCount;
    }
    public void setFollowCount(Integer followCount) {
        this.followCount = followCount;
    }
    public Integer getDealCount() {
        return dealCount;
    }
    public void setDealCount(Integer dealCount) {
        this.dealCount = dealCount;
    }
    public Date getLastTime() {
        return lastTime;
    }
    public void setLastTime(Date lastTime) {
        this.lastTime = lastTime;
    }
    public Date getNextTime() {
        return nextTime;
    }
    public void setNextTime(Date nextTime) {
        this.nextTime = nextTime;
    }
    public String getWebsite() {
        return website;
    }
    public void setWebsite(String website) {
        this.website = website;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    
    public String getTags() {
        return tags;
    }
    public void setTags(String tags) {
        this.tags = tags;
    }
    public Integer getAreaId() {
        return areaId;
    }
    public void setAreaId(Integer areaId) {
        this.areaId = areaId;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getTelephone() {
        return telephone;
    }
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }
    public Integer getSex() {
        return sex;
    }
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public Long getContactsId() {
        return contactsId;
    }
    public void setContactsId(Long contactsId) {
        this.contactsId = contactsId;
    }
    public Long getCreateUserId() {
        return createUserId;
    }
    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }
    public Long getOwnerUserId() {
        return ownerUserId;
    }
    public void setOwnerUserId(Long ownerUserId) {
        this.ownerUserId = ownerUserId;
        if(ownerUserId != null)
          this.ownerUserIdStr = ownerUserId.toString();
    }
    public String getOwnerUserIdStr() {
        return ownerUserIdStr;
    }
    public void setOwnerUserIdStr(String ownerUserIdStr) {
        this.ownerUserIdStr = ownerUserIdStr;
    }
    public Integer getProvinceId() {
        return provinceId;
    }
    public void setProvinceId(Integer provinceId) {
        this.provinceId = provinceId;
    }
    public Integer getCityId() {
        return cityId;
    }
    public void setCityId(Integer cityId) {
        this.cityId = cityId;
    }
    public Integer getLockStatus() {
        return lockStatus;
    }
    public void setLockStatus(Integer lockStatus) {
        this.lockStatus = lockStatus;
    }
    public String getCollaborator() {
        return collaborator;
    }
    public void setCollaborator(String collaborator) {
        this.collaborator = collaborator;
    }
    public Long getSaUserId() {
        return saUserId;
    }
    public void setSaUserId(Long saUserId) {
        this.saUserId = saUserId;
    }
    public String getSaUserIdStr() {
        return saUserIdStr;
    }
    public void setSaUserIdStr(String saUserIdStr) {
        this.saUserIdStr = saUserIdStr;
    }
    public Integer getBusinessCount() {
        return businessCount;
    }
    public void setBusinessCount(Integer businessCount) {
        this.businessCount = businessCount;
    }
    public Date getBirthday() {
        return birthday;
    }
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
    public String getCname() {
        return cname;
    }
    public void setCname(String cname) {
        this.cname = cname;
    }
}
